package com.xiaogang.ggfw.config.error;

import com.xiaogang.ggfw.utils.common.APIRs;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ProjectName : caldav
 * @作者 : 侯小刚
 * @描述 :
 * @创建日期 : 2023/4/28 11:51
 */

@RestControllerAdvice
public class CustomExceptionHandler {

    @ExceptionHandler(GgfwException.class)
    public APIRs handleCalendarException(GgfwException e) {
        String msg = e.getMessage();
        return new APIRs(e.getCode(), msg);
    }
}
